﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using A2DFramework.EventService.Factory;
using A2DFramework.EventService.SuperSocket.Core;
using System.Threading;

namespace A2DFramework.EventService.Providers
{
    class RedisEventBusProvider : IEventBusProvider
    {
        public void Publish(IEvent evt)
        {
            RedisFactory.GetRedisClient_Publishable().PublishMessage(evt.GetType().FullName, Helper.GeneratePublishCommand(evt));
        }


        public void Subscribe(string evtClassType)
        {
            RedisFactory.GetRedisClient_Subscribe().Subscribe(evtClassType);

            RedisFactory.TouchReceiveThread();
        }
    }
}
